home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 January: Mac OS SDK / Dev.CD Jan 99 SDK1.toast / Development Kits / Interfaces&Libraries / Universal / Interfaces / PInterfaces / QD3DRenderer.p < prev    next >
Encoding:
Text File  |  1998-08-17  |  42.4 KB  |  1,247 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        QD3DRenderer.p
  3.  
  4.      Contains:    Q3Renderer types and routines                                          
  5.  
  6.      Version:    Technology:    Quickdraw 3D 1.5.4
  7.                  Release:    Universal Interfaces 3.2
  8.  
  9.      Copyright:    © 1995-1998 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. }
  17. {$IFC UNDEFINED UsingIncludes}
  18. {$SETC UsingIncludes := 0}
  19. {$ENDC}
  20.  
  21. {$IFC NOT UsingIncludes}
  22.  UNIT QD3DRenderer;
  23.  INTERFACE
  24. {$ENDC}
  25.  
  26. {$IFC UNDEFINED __QD3DRENDERER__}
  27. {$SETC __QD3DRENDERER__ := 1}
  28.  
  29. {$I+}
  30. {$SETC QD3DRendererIncludes := UsingIncludes}
  31. {$SETC UsingIncludes := 1}
  32.  
  33. {$IFC UNDEFINED __QD3D__}
  34. {$I QD3D.p}
  35. {$ENDC}
  36. {$IFC UNDEFINED __QD3DSET__}
  37. {$I QD3DSet.p}
  38. {$ENDC}
  39. {$IFC UNDEFINED __QD3DVIEW__}
  40. {$I QD3DView.p}
  41. {$ENDC}
  42.  
  43. {$IFC TARGET_OS_MAC }
  44. {$IFC UNDEFINED __EVENTS__}
  45. {$I Events.p}
  46. {$ENDC}
  47. {$ENDC}  {TARGET_OS_MAC}
  48.  
  49.  
  50. {$PUSH}
  51. {$ALIGN POWER}
  52. {$LibExport+}
  53.  
  54. {*****************************************************************************
  55.  **                                                                             **
  56.  **                            User Interface Things                             **
  57.  **                                                                             **
  58.  ****************************************************************************}
  59. {$IFC TARGET_OS_MAC }
  60. {
  61.  *  A callback to an application's event handling code. This is needed to    
  62.  *  support movable modal dialogs. The dialog's event filter calls this      
  63.  *  callback with events it does not handle.                                 
  64.  *  If an application handles the event it should return kQ3True.            
  65.  *  If the application does not handle the event it must return kQ3False and 
  66.  *  the dialog's event filter will pass the event to the system unhandled.   
  67.  }
  68.  
  69. TYPE
  70. {$IFC TYPED_FUNCTION_POINTERS}
  71.     TQ3MacOSDialogEventHandler = FUNCTION({CONST}VAR event: EventRecord): TQ3Boolean; C;
  72. {$ELSEC}
  73.     TQ3MacOSDialogEventHandler = ProcPtr;
  74. {$ENDC}
  75.  
  76.     TQ3DialogAnchorPtr = ^TQ3DialogAnchor;
  77.     TQ3DialogAnchor = RECORD
  78.         clientEventHandler:        TQ3MacOSDialogEventHandler;
  79.     END;
  80.  
  81. {$ENDC}  {TARGET_OS_MAC}
  82.  
  83. {$IFC TARGET_OS_WIN32 }
  84.  
  85. TYPE
  86.     TQ3DialogAnchor = RECORD
  87.         ownerWindow:            HWND;
  88.     END;
  89.  
  90. {$ENDC}  {TARGET_OS_WIN32}
  91.  
  92. {$IFC TARGET_OS_UNIX }
  93.  
  94. TYPE
  95.     TQ3DialogAnchorPtr = ^TQ3DialogAnchor;
  96.     TQ3DialogAnchor = RECORD
  97.         notUsed:                Ptr;                                    {  place holder  }
  98.     END;
  99.  
  100. {$ENDC}  {TARGET_OS_UNIX}
  101.  
  102. {*****************************************************************************
  103.  **                                                                             **
  104.  **                            Renderer Functions                                 **
  105.  **                                                                             **
  106.  ****************************************************************************}
  107. FUNCTION Q3Renderer_NewFromType(rendererObjectType: TQ3ObjectType): TQ3RendererObject; C;
  108. FUNCTION Q3Renderer_GetType(renderer: TQ3RendererObject): TQ3ObjectType; C;
  109.  
  110. { Q3Renderer_Flush has been replaced by Q3View_Flush }
  111. { Q3Renderer_Sync has been replaced by Q3View_Sync }
  112.  
  113. {
  114.  *    Q3Renderer_IsInteractive
  115.  *        Determine if this renderer is intended to be used interactively.
  116.  }
  117. FUNCTION Q3Renderer_IsInteractive(renderer: TQ3RendererObject): TQ3Boolean; C;
  118.  
  119. {
  120.  *    Q3Renderer_HasModalConfigure
  121.  *        Determine if this renderer has a modal settings dialog.
  122.  *
  123.  *    Q3Renderer_ModalConfigure
  124.  *        Have the renderer pop up a modal dialog box to configure its settings.
  125.  *    dialogAnchor - is platform specific data passed by the client to support
  126.  *      movable modal dialogs. 
  127.  *    MacOS: this is a callback to the calling application's event handler.
  128.  *      The renderer calls this function with events not handled by the 
  129.  *      settings dialog. This is necessary in order to support movable modal 
  130.  *      dialogs. An application's event handler must return kQ3True if it 
  131.  *      handles the event passed to the callback or kQ3False if not. 
  132.  *      An application which doesn't want to support a movable modal configure
  133.  *      dialog should pass NULL for the clientEventHandler of TQ3DialogAnchor.
  134.  *    Win32: this is the HWND of the owning window (typically an application's
  135.  *      main window).
  136.  *  canceled - returns a boolean inditacating that the user canceled the 
  137.  *    dialog.
  138.  *      
  139.  }
  140. FUNCTION Q3Renderer_HasModalConfigure(renderer: TQ3RendererObject): TQ3Boolean; C;
  141. FUNCTION Q3Renderer_ModalConfigure(renderer: TQ3RendererObject; dialogAnchor: TQ3DialogAnchor; VAR canceled: TQ3Boolean): TQ3Status; C;
  142. {
  143.  *    Q3RendererClass_GetNickNameString
  144.  *        Allows an application to get a renderers name string, the 
  145.  *        renderer is responsible for storing this in a localizable format
  146.  *        for example as a resource.  This string can then be used to provide
  147.  *        a selection mechanism for an application (for example in a menu).
  148.  *
  149.  *        If this call returns nil in the supplied string, then the App may 
  150.  *         choose to use the class name for the renderer.  You should always 
  151.  *        try to get the name string before using the class name, since the
  152.  *        class name is not localizable.
  153.  }
  154. FUNCTION Q3RendererClass_GetNickNameString(rendererClassType: TQ3ObjectType; VAR rendererClassString: TQ3ObjectClassNameString): TQ3Status; C;
  155.  
  156. {
  157.  *    Q3Renderer_GetConfigurationData
  158.  *        Allows an application to collect private renderer configuration data
  159.  *      which it will then save. For example in a preference file or in a 
  160.  *        style template. An application should tag this data with the 
  161.  *        Renderer's object  name.
  162.  *    
  163.  *        if dataBuffer is NULL actualDataSize returns the required size in 
  164.  *        bytes of a data buffer large enough to store private data. 
  165.  *
  166.  *      bufferSize is the actual size of the memory block pointed to by 
  167.  *        dataBuffer
  168.  *
  169.  *        actualDataSize - on return the actual number of bytes written to the 
  170.  *        buffer or if dataBuffer is NULL the required size of dataBuffer
  171.  * 
  172.  }
  173. FUNCTION Q3Renderer_GetConfigurationData(renderer: TQ3RendererObject; VAR dataBuffer: UInt8; bufferSize: UInt32; VAR actualDataSize: UInt32): TQ3Status; C;
  174. FUNCTION Q3Renderer_SetConfigurationData(renderer: TQ3RendererObject; VAR dataBuffer: UInt8; bufferSize: UInt32): TQ3Status; C;
  175.  
  176.  
  177. {*****************************************************************************
  178.  **                                                                             **
  179.  **                        Interactive Renderer Specific Functions                 **
  180.  **                                                                             **
  181.  ****************************************************************************}
  182. { CSG IDs attribute }
  183. { Object IDs, to be applied as attributes on geometries }
  184.  
  185. CONST
  186.     kQ3AttributeTypeConstructiveSolidGeometryID = 'csgi';
  187.  
  188.     kQ3SolidGeometryObjNone        = -1;
  189.     kQ3SolidGeometryObjA        = 0;
  190.     kQ3SolidGeometryObjB        = 1;
  191.     kQ3SolidGeometryObjC        = 2;
  192.     kQ3SolidGeometryObjD        = 3;
  193.     kQ3SolidGeometryObjE        = 4;
  194.  
  195. { Possible CSG equations }
  196.  
  197. TYPE
  198.     TQ3CSGEquation                 = LONGINT;
  199. CONST
  200.     kQ3CSGEquationAandB            = {TQ3CSGEquation}$88888888;
  201.     kQ3CSGEquationAandnotB        = {TQ3CSGEquation}$22222222;
  202.     kQ3CSGEquationAanBonCad        = {TQ3CSGEquation}$2F222F22;
  203.     kQ3CSGEquationnotAandB        = {TQ3CSGEquation}$44444444;
  204.     kQ3CSGEquationnAaBorCanB    = {TQ3CSGEquation}$74747474;
  205.  
  206. FUNCTION Q3InteractiveRenderer_SetCSGEquation(renderer: TQ3RendererObject; equation: TQ3CSGEquation): TQ3Status; C;
  207. FUNCTION Q3InteractiveRenderer_GetCSGEquation(renderer: TQ3RendererObject; VAR equation: TQ3CSGEquation): TQ3Status; C;
  208. FUNCTION Q3InteractiveRenderer_SetPreferences(renderer: TQ3RendererObject; vendorID: LONGINT; engineID: LONGINT): TQ3Status; C;
  209. FUNCTION Q3InteractiveRenderer_GetPreferences(renderer: TQ3RendererObject; VAR vendorID: LONGINT; VAR engineID: LONGINT): TQ3Status; C;
  210. FUNCTION Q3InteractiveRenderer_SetDoubleBufferBypass(renderer: TQ3RendererObject; bypass: TQ3Boolean): TQ3Status; C;
  211. FUNCTION Q3InteractiveRenderer_GetDoubleBufferBypass(renderer: TQ3RendererObject; VAR bypass: TQ3Boolean): TQ3Status; C;
  212. FUNCTION Q3InteractiveRenderer_SetRAVEContextHints(renderer: TQ3RendererObject; RAVEContextHints: UInt32): TQ3Status; C;
  213. FUNCTION Q3InteractiveRenderer_GetRAVEContextHints(renderer: TQ3RendererObject; VAR RAVEContextHints: UInt32): TQ3Status; C;
  214. FUNCTION Q3InteractiveRenderer_SetRAVETextureFilter(renderer: TQ3RendererObject; RAVEtextureFilterValue: UInt32): TQ3Status; C;
  215. FUNCTION Q3InteractiveRenderer_GetRAVETextureFilter(renderer: TQ3RendererObject; VAR RAVEtextureFilterValue: UInt32): TQ3Status; C;
  216.  
  217. {*****************************************************************************
  218.  **                                                                             **
  219.  **                            Renderer View Tools                                 **
  220.  **                                                                             **
  221.  **                    You may only call these methods from a plug-in             **
  222.  **                                                                             **
  223.  ****************************************************************************}
  224. {
  225.  *    Call by a renderer to call the user "idle" method, with progress 
  226.  *    information.
  227.  *    
  228.  *    Pass in (view, 0, n) on first call
  229.  *    Pass in (view, 1..n-1, n) during rendering
  230.  *    Pass in (view, n, n) upon completion
  231.  *    
  232.  *    Note: The user must have supplied an idleProgress method with 
  233.  *    Q3XView_SetIdleProgressMethod. Otherwise, the generic idle method is
  234.  *    called with no progress data. e.g. the Q3View_SetIdleMethod method
  235.  *    is called instead. (current and final are ignored, essentially.)
  236.  *
  237.  *    Returns kQ3Failure if rendering is cancelled.
  238.  }
  239. FUNCTION Q3XView_IdleProgress(view: TQ3ViewObject; current: UInt32; completed: UInt32): TQ3Status; C;
  240. {
  241.  *    Called by an asynchronous renderer when it completes a frame.
  242.  }
  243. FUNCTION Q3XView_EndFrame(view: TQ3ViewObject): TQ3Status; C;
  244.  
  245. {*****************************************************************************
  246.  **                                                                             **
  247.  **                            Renderer AttributeSet Tools                         **
  248.  **                                                                             **
  249.  **                    You may only call these methods from a plug-in             **
  250.  **                                                                             **
  251.  ****************************************************************************}
  252. {
  253.  *    Faster access to geometry attribute sets.
  254.  *    
  255.  *    Returns pointer to INTERNAL data structure for elements and attributes
  256.  *    in an attributeSet, or NULL if no attribute exists.
  257.  *    
  258.  *    For attributes of type kQ3AttributeType..., the internal data structure
  259.  *    is identical to the data structure used in Q3AttributeSet_Add.
  260.  }
  261. FUNCTION Q3XAttributeSet_GetPointer(attributeSet: TQ3AttributeSet; attributeType: TQ3AttributeType): Ptr; C;
  262.  
  263.  
  264. CONST
  265.     kQ3XAttributeMaskNone        = 0;
  266.     kQ3XAttributeMaskSurfaceUV    = $01;
  267.     kQ3XAttributeMaskShadingUV    = $02;
  268.     kQ3XAttributeMaskNormal        = $04;
  269.     kQ3XAttributeMaskAmbientCoefficient = $08;
  270.     kQ3XAttributeMaskDiffuseColor = $10;
  271.     kQ3XAttributeMaskSpecularColor = $20;
  272.     kQ3XAttributeMaskSpecularControl = $40;
  273.     kQ3XAttributeMaskTransparencyColor = $80;
  274.     kQ3XAttributeMaskSurfaceTangent = $0100;
  275.     kQ3XAttributeMaskHighlightState = $0200;
  276.     kQ3XAttributeMaskSurfaceShader = $0400;
  277.     kQ3XAttributeMaskCustomAttribute = $80000000;
  278.     kQ3XAttributeMaskAll        = $800007FF;
  279.     kQ3XAttributeMaskInherited    = $03FF;
  280.     kQ3XAttributeMaskInterpolated = $01FF;
  281.  
  282.  
  283. TYPE
  284.     TQ3XAttributeMask                    = UInt32;
  285. FUNCTION Q3XAttributeSet_GetMask(attributeSet: TQ3AttributeSet): TQ3XAttributeMask; C;
  286.  
  287. {*****************************************************************************
  288.  **                                                                             **
  289.  **                            Renderer Draw Context Tools                         **
  290.  **                                                                             **
  291.  ****************************************************************************}
  292.  
  293. TYPE
  294.     TQ3XDrawRegion = ^LONGINT;
  295. FUNCTION Q3XDrawContext_GetDrawRegion(drawContext: TQ3DrawContextObject; VAR drawRegion: TQ3XDrawRegion): TQ3Status; C;
  296.  
  297. TYPE
  298.     TQ3XDrawContextValidationMasks  = LONGINT;
  299. CONST
  300.     kQ3XDrawContextValidationClearFlags = {TQ3XDrawContextValidationMasks}$00000000;
  301.     kQ3XDrawContextValidationDoubleBuffer = {TQ3XDrawContextValidationMasks}$01;
  302.     kQ3XDrawContextValidationShader = {TQ3XDrawContextValidationMasks}$02;
  303.     kQ3XDrawContextValidationClearFunction = {TQ3XDrawContextValidationMasks}$04;
  304.     kQ3XDrawContextValidationActiveBuffer = {TQ3XDrawContextValidationMasks}$08;
  305.     kQ3XDrawContextValidationInternalOffScreen = {TQ3XDrawContextValidationMasks}$10;
  306.     kQ3XDrawContextValidationPane = {TQ3XDrawContextValidationMasks}$20;
  307.     kQ3XDrawContextValidationMask = {TQ3XDrawContextValidationMasks}$40;
  308.     kQ3XDrawContextValidationDevice = {TQ3XDrawContextValidationMasks}$80;
  309.     kQ3XDrawContextValidationWindow = {TQ3XDrawContextValidationMasks}$0100;
  310.     kQ3XDrawContextValidationWindowSize = {TQ3XDrawContextValidationMasks}$0200;
  311.     kQ3XDrawContextValidationWindowClip = {TQ3XDrawContextValidationMasks}$0400;
  312.     kQ3XDrawContextValidationWindowPosition = {TQ3XDrawContextValidationMasks}$0800;
  313.     kQ3XDrawContextValidationPlatformAttributes = {TQ3XDrawContextValidationMasks}$1000;
  314.     kQ3XDrawContextValidationForegroundShader = {TQ3XDrawContextValidationMasks}$2000;
  315.     kQ3XDrawContextValidationBackgroundShader = {TQ3XDrawContextValidationMasks}$4000;
  316.     kQ3XDrawContextValidationColorPalette = {TQ3XDrawContextValidationMasks}$8000;
  317.     kQ3XDrawContextValidationAll = {TQ3XDrawContextValidationMasks}$FFFFFFFF;
  318.  
  319.  
  320. TYPE
  321.     TQ3XDrawContextValidation            = UInt32;
  322. FUNCTION Q3XDrawContext_ClearValidationFlags(drawContext: TQ3DrawContextObject): TQ3Status; C;
  323. FUNCTION Q3XDrawContext_GetValidationFlags(drawContext: TQ3DrawContextObject; VAR validationFlags: TQ3XDrawContextValidation): TQ3Status; C;
  324.  
  325. {*****************************************************************************
  326.  **                                                                             **
  327.  **                            Renderer Draw Region Tools                         **
  328.  **                                                                             **
  329.  ****************************************************************************}
  330.  
  331. TYPE
  332.     TQ3XDevicePixelType         = LONGINT;
  333. CONST
  334.                                                                 {  These do not indicate byte ordering    }
  335.     kQ3XDevicePixelTypeInvalid    = {TQ3XDevicePixelType}0;        {  Unknown, un-initialized type      }
  336.     kQ3XDevicePixelTypeRGB32    = {TQ3XDevicePixelType}1;        {  Alpha:8 (ignored), R:8, G:8, B:8  }
  337.     kQ3XDevicePixelTypeARGB32    = {TQ3XDevicePixelType}2;        {  Alpha:8, R:8, G:8, B:8               }
  338.     kQ3XDevicePixelTypeRGB24    = {TQ3XDevicePixelType}3;        {  24 bits/pixel, R:8, G:8, B:8      }
  339.     kQ3XDevicePixelTypeRGB16    = {TQ3XDevicePixelType}4;        {  Alpha:1 (ignored), R:5, G:5, B:5  }
  340.     kQ3XDevicePixelTypeARGB16    = {TQ3XDevicePixelType}5;        {  Alpha:1, R:5, G:5, B:5               }
  341.     kQ3XDevicePixelTypeRGB16_565 = {TQ3XDevicePixelType}6;        {  16 bits/pixel, R:5, G:6, B:5      }
  342.     kQ3XDevicePixelTypeIndexed8    = {TQ3XDevicePixelType}7;        {  8-bit color table index              }
  343.     kQ3XDevicePixelTypeIndexed4    = {TQ3XDevicePixelType}8;        {  4-bit color table index              }
  344.     kQ3XDevicePixelTypeIndexed2    = {TQ3XDevicePixelType}9;        {  2-bit color table index              }
  345.     kQ3XDevicePixelTypeIndexed1    = {TQ3XDevicePixelType}10;        {  1-bit color table index              }
  346.  
  347.  
  348. TYPE
  349.     TQ3XClipMaskState             = LONGINT;
  350. CONST
  351.     kQ3XClipMaskFullyExposed    = {TQ3XClipMaskState}0;
  352.     kQ3XClipMaskPartiallyExposed = {TQ3XClipMaskState}1;
  353.     kQ3XClipMaskNotExposed        = {TQ3XClipMaskState}2;
  354.  
  355.  
  356. TYPE
  357.     TQ3XColorDescriptorPtr = ^TQ3XColorDescriptor;
  358.     TQ3XColorDescriptor = RECORD
  359.         redShift:                UInt32;
  360.         redMask:                UInt32;
  361.         greenShift:                UInt32;
  362.         greenMask:                UInt32;
  363.         blueShift:                UInt32;
  364.         blueMask:                UInt32;
  365.         alphaShift:                UInt32;
  366.         alphaMask:                UInt32;
  367.     END;
  368.  
  369.     TQ3XDrawRegionDescriptorPtr = ^TQ3XDrawRegionDescriptor;
  370.     TQ3XDrawRegionDescriptor = RECORD
  371.         width:                    UInt32;
  372.         height:                    UInt32;
  373.         rowBytes:                UInt32;
  374.         pixelSize:                UInt32;
  375.         pixelType:                TQ3XDevicePixelType;
  376.         colorDescriptor:        TQ3XColorDescriptor;
  377.         bitOrder:                TQ3Endian;
  378.         byteOrder:                TQ3Endian;
  379.         clipMask:                TQ3BitmapPtr;
  380.     END;
  381.  
  382.     TQ3XDrawRegionServicesMasks  = LONGINT;
  383. CONST
  384.     kQ3XDrawRegionServicesNoneFlag = {TQ3XDrawRegionServicesMasks}0;
  385.     kQ3XDrawRegionServicesClearFlag = {TQ3XDrawRegionServicesMasks}$01;
  386.     kQ3XDrawRegionServicesDontLockDDSurfaceFlag = {TQ3XDrawRegionServicesMasks}$02;
  387.  
  388.  
  389. TYPE
  390.     TQ3XDrawRegionServices                = UInt32;
  391. {$IFC TYPED_FUNCTION_POINTERS}
  392.     TQ3XDrawRegionRendererPrivateDeleteMethod = PROCEDURE(rendererPrivate: UNIV Ptr); C;
  393. {$ELSEC}
  394.     TQ3XDrawRegionRendererPrivateDeleteMethod = ProcPtr;
  395. {$ENDC}
  396.  
  397. FUNCTION Q3XDrawRegion_GetDeviceScaleX(drawRegion: TQ3XDrawRegion; VAR deviceScaleX: Single): TQ3Status; C;
  398. FUNCTION Q3XDrawRegion_GetDeviceScaleY(drawRegion: TQ3XDrawRegion; VAR deviceScaleY: Single): TQ3Status; C;
  399.  
  400. FUNCTION Q3XDrawRegion_GetDeviceOffsetX(drawRegion: TQ3XDrawRegion; VAR deviceOffsetX: Single): TQ3Status; C;
  401. FUNCTION Q3XDrawRegion_GetDeviceOffsetY(drawRegion: TQ3XDrawRegion; VAR deviceOffsetX: Single): TQ3Status; C;
  402.  
  403. FUNCTION Q3XDrawRegion_GetWindowScaleX(drawRegion: TQ3XDrawRegion; VAR windowScaleX: Single): TQ3Status; C;
  404. FUNCTION Q3XDrawRegion_GetWindowScaleY(drawRegion: TQ3XDrawRegion; VAR windowScaleY: Single): TQ3Status; C;
  405.  
  406. FUNCTION Q3XDrawRegion_GetWindowOffsetX(drawRegion: TQ3XDrawRegion; VAR windowOffsetX: Single): TQ3Status; C;
  407. FUNCTION Q3XDrawRegion_GetWindowOffsetY(drawRegion: TQ3XDrawRegion; VAR windowOffsetY: Single): TQ3Status; C;
  408. FUNCTION Q3XDrawRegion_IsActive(drawRegion: TQ3XDrawRegion; VAR isActive: TQ3Boolean): TQ3Status; C;
  409.  
  410. FUNCTION Q3XDrawRegion_GetNextRegion(drawRegion: TQ3XDrawRegion; VAR nextDrawRegion: TQ3XDrawRegion): TQ3Status; C;
  411.  *  One of the next two functions must be called before using a draw region 
  412.  }
  413. {
  414.  *    Use this Start function if double buffering/image access services from the
  415.  *    Draw Context are not needed, you may still request clear for example
  416.  }
  417. FUNCTION Q3XDrawRegion_Start(drawRegion: TQ3XDrawRegion; services: TQ3XDrawRegionServices; VAR descriptor: TQ3XDrawRegionDescriptorPtr): TQ3Status; C;
  418. {
  419.  *    Use this Start function if double buffering or image access services from 
  420.  *  the Draw Context are needed.
  421.  }
  422. FUNCTION Q3XDrawRegion_StartAccessToImageBuffer(drawRegion: TQ3XDrawRegion; services: TQ3XDrawRegionServices; VAR descriptor: TQ3XDrawRegionDescriptorPtr; VAR image: UNIV Ptr): TQ3Status; C;
  423. {
  424.  *    This function is used to indicate that access to a DrawRegion is ended.
  425.  }
  426. FUNCTION Q3XDrawRegion_End(drawRegion: TQ3XDrawRegion): TQ3Status; C;
  427. FUNCTION Q3XDrawRegion_GetDeviceTransform(drawRegion: TQ3XDrawRegion; VAR deviceTransform: TQ3Matrix4x4Ptr): TQ3Status; C;
  428. FUNCTION Q3XDrawRegion_GetClipFlags(drawRegion: TQ3XDrawRegion; VAR clipMaskState: TQ3XClipMaskState): TQ3Status; C;
  429. FUNCTION Q3XDrawRegion_GetClipMask(drawRegion: TQ3XDrawRegion; VAR clipMask: TQ3BitmapPtr): TQ3Status; C;
  430. {$IFC TARGET_OS_MAC }
  431. FUNCTION Q3XDrawRegion_GetClipRegion(drawRegion: TQ3XDrawRegion; VAR rgnHandle: RgnHandle): TQ3Status; C;
  432. FUNCTION Q3XDrawRegion_GetGDHandle(drawRegion: TQ3XDrawRegion; VAR gdHandle: GDHandle): TQ3Status; C;
  433. {$ENDC}  {TARGET_OS_MAC}
  434.  
  435. FUNCTION Q3XDrawRegion_GetRendererPrivate(drawRegion: TQ3XDrawRegion; VAR rendererPrivate: UNIV Ptr): TQ3Status; C;
  436. FUNCTION Q3XDrawRegion_SetRendererPrivate(drawRegion: TQ3XDrawRegion; rendererPrivate: UNIV Ptr; deleteMethod: TQ3XDrawRegionRendererPrivateDeleteMethod): TQ3Status; C;
  437. FUNCTION Q3XDrawRegion_SetUseDefaultRendererFlag(drawRegion: TQ3XDrawRegion; flag: TQ3Boolean): TQ3Status; C;
  438. FUNCTION Q3XDrawRegion_GetUseDefaultRendererFlag(drawRegion: TQ3XDrawRegion; VAR useDefaultRenderingFlag: TQ3Boolean): TQ3Status; C;
  439.  
  440.  
  441. {*****************************************************************************
  442.  **                                                                             **
  443.  **                            Renderer Class Methods                             **
  444.  **                                                                             **
  445.  ****************************************************************************}
  446. {
  447.  *    Methods from Object
  448.  *        kQ3XMethodTypeObjectClassRegister
  449.  *        kQ3XMethodTypeObjectClassUnregister
  450.  *        kQ3XMethodTypeObjectNew
  451.  *        kQ3XMethodTypeObjectDelete
  452.  *        kQ3XMethodTypeObjectRead
  453.  *        kQ3XMethodTypeObjectTraverse
  454.  *        kQ3XMethodTypeObjectWrite
  455.  *        
  456.  *    Methods from Shared
  457.  *        kQ3MethodTypeSharedEdited
  458.  *
  459.  *    Renderer Methods
  460.  *    
  461.  *    The renderer methods should be implemented according to the type
  462.  *    of renderer being written.
  463.  *
  464.  *    For the purposes of documentation, there are two basic types of
  465.  *    renderers: 
  466.  *
  467.  *        Interactive
  468.  *            Interactive Renderer
  469.  *            WireFrame Renderer
  470.  *        
  471.  *        Deferred
  472.  *            a ray-tracer
  473.  *            painter's algorithm renderer (cached in a BSP triangle tree)
  474.  *            an artistic renderer (simulates a pencil drawing, etc.)
  475.  *
  476.  *    The main difference is how each renderer handles incoming state and 
  477.  *    geometry.
  478.  *
  479.  *    An interactive renderer immediately transforms, culls, and shades
  480.  *    incoming geometry and performs rasterization. For example, in a 
  481.  *    single-buffered WireFrame renderer, you will see a new triangle
  482.  *    immediately after Q3Triangle_Draw (if it's visible, of course).
  483.  *
  484.  *    A deferred renderer caches the view state and each geometry, 
  485.  *    converting into any internal queue of drawing commands. Rasterization
  486.  *    is not actually performed until all data has been submitted.
  487.  *    
  488.  *    For example, a ray-tracer may not rasterize anything until the
  489.  *    end of the rendering loop, or until an EndFrame call is made.
  490.  }
  491.  
  492. {*****************************************************************************
  493.  **                                                                             **
  494.  **                        Renderer User Interface Methods                         **
  495.  **                                                                             **
  496.  ****************************************************************************}
  497. {
  498.  *    kQ3XMethodTypeRendererIsInteractive
  499.  *    
  500.  *    There is no actual method with this - the metahandler simply returns
  501.  *  "(TQ3XFunctionPointer)kQ3True" for this "method" if the renderer is 
  502.  *  intended to be used in interactive settings, and   
  503.  *    "(TQ3XFunctionPointer)kQ3False" otherwise. 
  504.  *  
  505.  *  If neither value is specified in the metahandler, the renderer 
  506.  *  is *assumed to be non-interactive*!!!
  507.  *    
  508.  *    OPTIONAL
  509.  }
  510.  
  511. CONST
  512.     kQ3XMethodTypeRendererIsInteractive = 'isin';
  513.  
  514.  
  515. {
  516.  *    TQ3XRendererModalConfigureMethod
  517.  *    
  518.  *    This method should pop up a modal dialog to edit the renderer settings 
  519.  *    found in the renderer private. 
  520.  *    
  521.  *    dialogAnchor - is platform specific data passed by the client to support
  522.  *      movable modal dialogs. 
  523.  *    MacOS: this is a callback to the calling application's event handler.
  524.  *      The renderer calls this function with events not handled by the 
  525.  *      settings dialog. This is necessary in order to support movable modal 
  526.  *      dialogs. An application's event handler must return kQ3True if it 
  527.  *      handles the event passed to the callback or kQ3False if not. 
  528.  *      An application which doesn't want to support a movable modal configure
  529.  *      dialog should pass NULL for the clientEventHandler of TQ3DialogAnchor.
  530.  *      A renderer should implement a non-movable style dialog in that case.
  531.  *    Win32: this is the HWND of the owning window (typically an application's
  532.  *      main window).  (Win32 application modal dialogs are always movable.)
  533.  *  canceled - returns a boolean inditacating that the user canceled the 
  534.  *    dialog.
  535.  *    
  536.  *    OPTIONAL
  537.  }
  538.     kQ3XMethodTypeRendererModalConfigure = 'rdmc';
  539.  
  540.  
  541. TYPE
  542. {$IFC TYPED_FUNCTION_POINTERS}
  543.     TQ3XRendererModalConfigureMethod = FUNCTION(renderer: TQ3RendererObject; dialogAnchor: TQ3DialogAnchor; VAR canceled: TQ3Boolean; rendererPrivate: UNIV Ptr): TQ3Status; C;
  544. {$ELSEC}
  545.     TQ3XRendererModalConfigureMethod = ProcPtr;
  546. {$ENDC}
  547.  
  548. {
  549.  *    kQ3XMethodTypeRendererGetNickNameString
  550.  *    
  551.  *        Allows an application to collect the name of the renderer for
  552.  *        display in a user interface item such as a menu.
  553.  *    
  554.  *        If dataBuffer is NULL actualDataSize returns the required size in 
  555.  *        bytes of a data buffer large enough to store the renderer name. 
  556.  *
  557.  *      bufferSize is the actual size of the memory block pointed to by 
  558.  *        dataBuffer
  559.  *
  560.  *        actualDataSize - on return the actual number of bytes written to the
  561.  *        buffer or if dataBuffer is NULL the required size of dataBuffer
  562.  *
  563.  *    OPTIONAL
  564.  }
  565.  
  566. CONST
  567.     kQ3XMethodTypeRendererGetNickNameString = 'rdns';
  568.  
  569.  
  570. TYPE
  571. {$IFC TYPED_FUNCTION_POINTERS}
  572.     TQ3XRendererGetNickNameStringMethod = FUNCTION(VAR dataBuffer: UInt8; bufferSize: UInt32; VAR actualDataSize: UInt32): TQ3Status; C;
  573. {$ELSEC}
  574.     TQ3XRendererGetNickNameStringMethod = ProcPtr;
  575. {$ENDC}
  576.  
  577. {
  578.  *    kQ3XMethodTypeRendererGetConfigurationData
  579.  *    
  580.  *        Allows an application to collect private configuration data from the
  581.  *      renderer which it will then save. For example in a preference file, 
  582.  *      a registry key (on Windows) or in a style template. An application 
  583.  *      should tag this data with the renderer's object name.
  584.  *    
  585.  *        If dataBuffer is NULL actualDataSize returns the required size in 
  586.  *        bytes of a data buffer large enough to store private data. 
  587.  *
  588.  *      bufferSize is the actual size of the memory block pointed to by 
  589.  *        dataBuffer
  590.  *
  591.  *        actualDataSize - on return the actual number of bytes written to the
  592.  *        buffer or if dataBuffer is NULL the required size of dataBuffer
  593.  *
  594.  *    OPTIONAL
  595.  }
  596.  
  597. CONST
  598.     kQ3XMethodTypeRendererGetConfigurationData = 'rdgp';
  599.  
  600.  
  601. TYPE
  602. {$IFC TYPED_FUNCTION_POINTERS}
  603.     TQ3XRendererGetConfigurationDataMethod = FUNCTION(renderer: TQ3RendererObject; VAR dataBuffer: UInt8; bufferSize: UInt32; VAR actualDataSize: UInt32; rendererPrivate: UNIV Ptr): TQ3Status; C;
  604. {$ELSEC}
  605.     TQ3XRendererGetConfigurationDataMethod = ProcPtr;
  606. {$ENDC}
  607.  
  608. {
  609.  *    TQ3XRendererSetConfigurationDataMethod
  610.  *    
  611.  *        Allows an application to pass private configuration data which has
  612.  *         previously  been obtained from a renderer via 
  613.  *        Q3Renderer_GetConfigurationData. For example in a preference file or 
  614.  *        in a style template. An application should tag this data with the 
  615.  *        renderer's object name.
  616.  *    
  617.  *      bufferSize is the actual size of the memory block pointed to by 
  618.  *        dataBuffer
  619.  *
  620.  *    OPTIONAL
  621.  }
  622.  
  623. CONST
  624.     kQ3XMethodTypeRendererSetConfigurationData = 'rdsp';
  625.  
  626.  
  627. TYPE
  628. {$IFC TYPED_FUNCTION_POINTERS}
  629.     TQ3XRendererSetConfigurationDataMethod = FUNCTION(renderer: TQ3RendererObject; VAR dataBuffer: UInt8; bufferSize: UInt32; rendererPrivate: UNIV Ptr): TQ3Status; C;
  630. {$ELSEC}
  631.     TQ3XRendererSetConfigurationDataMethod = ProcPtr;
  632. {$ENDC}
  633.  
  634. {*****************************************************************************
  635.  **                                                                             **
  636.  **                        Renderer Drawing State Methods                         **
  637.  **                                                                             **
  638.  ****************************************************************************}
  639. {
  640.  *    TQ3RendererStartFrame
  641.  *    
  642.  *    The StartFrame method is called first at Q3View_StartRendering
  643.  *    and should:
  644.  *        - initialize any renderer state to defaults
  645.  *        - extract any and all useful data from the drawContext
  646.  *
  647.  *    If your renderer passed in kQ3RendererFlagClearBuffer at 
  648.  *    registration, then it should also:
  649.  *        - clear the drawContext 
  650.  *    
  651.  *        When clearing, your renderer may opt to:
  652.  *        - NOT clear anything (if you touch every pixel, for example)
  653.  *        - to clear with your own routine, or
  654.  *        - to use the draw context default clear method by calling 
  655.  *        Q3DrawContext_Clear. Q3DrawContext_Clear takes advantage of
  656.  *        any available hardware in the system for clearing.
  657.  *    
  658.  *    This call also signals the start of all default submit commands from
  659.  *    the view. The renderer will receive updates for the default view
  660.  *    state via its Update methods before StartPass is called.
  661.  *    
  662.  *    REQUIRED
  663.  }
  664.  
  665. CONST
  666.     kQ3XMethodTypeRendererStartFrame = 'rdcl';
  667.  
  668.  
  669. TYPE
  670. {$IFC TYPED_FUNCTION_POINTERS}
  671.     TQ3XRendererStartFrameMethod = FUNCTION(view: TQ3ViewObject; rendererPrivate: UNIV Ptr; drawContext: TQ3DrawContextObject): TQ3Status; C;
  672. {$ELSEC}
  673.     TQ3XRendererStartFrameMethod = ProcPtr;
  674. {$ENDC}
  675.  
  676. {
  677.  *    kQ3XMethodTypeRendererStartPass
  678.  *    TQ3XRendererStartPassMethod
  679.  *    
  680.  *    The StartPass method is called during Q3View_StartRendering but after
  681.  *    the StartFrame command. It should:
  682.  *        - collect camera and light information
  683.  *    
  684.  *    If your renderer supports deferred camera transformation, camera is the
  685.  *    main camera which will be submitted in the hierarchy somewhere. It
  686.  *    is never NULL.
  687.  *
  688.  *    If your renderer does not support deferred camera transformation, camera
  689.  *    is the transformed camera.
  690.  *
  691.  *    If your renderer supports deferred light transformation, lights will be
  692.  *    NULL, and will be submitted to your light draw methods instead.
  693.  *
  694.  *    This call signals the end of the default update state, and the start of 
  695.  *  submit commands from the user to the view.
  696.  *
  697.  *    REQUIRED
  698.  }
  699.  
  700. CONST
  701.     kQ3XMethodTypeRendererStartPass = 'rdst';
  702.  
  703.  
  704. TYPE
  705. {$IFC TYPED_FUNCTION_POINTERS}
  706.     TQ3XRendererStartPassMethod = FUNCTION(view: TQ3ViewObject; rendererPrivate: UNIV Ptr; camera: TQ3CameraObject; lightGroup: TQ3GroupObject): TQ3Status; C;
  707. {$ELSEC}
  708.     TQ3XRendererStartPassMethod = ProcPtr;
  709. {$ENDC}
  710.  
  711. {
  712.  *    kQ3XMethodTypeRendererFlushFrame
  713.  *    TQ3XRendererFlushFrameMethod
  714.  *    
  715.  *    This call is only implemented by asynchronous renderers.
  716.  *    
  717.  *    The FlushFrame method is called between the StartPass and EndPass
  718.  *    methods and is called when the user wishes to flush any asynchronous
  719.  *    drawing tasks (which draw to the drawcontext), but does not want 
  720.  *    to block.
  721.  *    
  722.  *    The result of this call is that an image should "eventually" appear
  723.  *    asynchronously.
  724.  *    
  725.  *    For asynchronous rendering, this call is non-blocking.
  726.  *    
  727.  *    An interactive renderer should ensure that all received
  728.  *    geometries are drawn in the image.
  729.  *    
  730.  *    An interactive renderer that talks to hardware should force
  731.  *    the hardware to generate an image.
  732.  *    
  733.  *    A deferred renderer should exhibit a similar behaviour,
  734.  *    though it is not required.  A deferred renderer should spawn
  735.  *    a process that generates a partial image from the currently
  736.  *    accumulated drawing state. 
  737.  *    
  738.  *    However, for renderers such as ray-tracers which generally are
  739.  *    quite compute-intensive, FlushFrame is not required and is a no-op.
  740.  *
  741.  *    OPTIONAL
  742.  }
  743.  
  744. CONST
  745.     kQ3XMethodTypeRendererFlushFrame = 'rdfl';
  746.  
  747.  
  748. TYPE
  749. {$IFC TYPED_FUNCTION_POINTERS}
  750.     TQ3XRendererFlushFrameMethod = FUNCTION(view: TQ3ViewObject; rendererPrivate: UNIV Ptr; drawContext: TQ3DrawContextObject): TQ3Status; C;
  751. {$ELSEC}
  752.     TQ3XRendererFlushFrameMethod = ProcPtr;
  753. {$ENDC}
  754.  
  755. {
  756.  *    kQ3XMethodTypeRendererEndPass
  757.  *    TQ3XRendererEndPassMethod
  758.  *    
  759.  *    The EndPass method is called at Q3View_EndRendering and signals
  760.  *    the end of submit commands to the view.
  761.  *
  762.  *    If an error occurs, the renderer should call Q3XError_Post and
  763.  *    return kQ3ViewStatusError.
  764.  *    
  765.  *    If a renderer requires another pass on the renderering data,
  766.  *    it should return kQ3ViewStatusRetraverse.
  767.  *    
  768.  *    If rendering was cancelled, this function will not be called
  769.  *    and the view will handle returning kQ3ViewStatusCancelled;
  770.  *    
  771.  *    Otherwise, your renderer should begin completing the process of 
  772.  *    generating the image in the drawcontext. If you have buffered
  773.  *    any drawing data, flush it. RendererEnd should have a similar
  774.  *    effect as RendererFlushFrame.
  775.  *    
  776.  *    If the renderer is synchronous:
  777.  *        - complete rendering of the entire frame
  778.  *        if the renderer supports kQ3RendererClassSupportDoubleBuffer
  779.  *            - Update the front buffer
  780.  *        else
  781.  *            - DrawContext will update the front buffer after returning
  782.  *
  783.  *    If the renderer is asynchronous
  784.  *        - spawn rendering thread for entire frame
  785.  *        if the renderer supports kQ3RendererClassSupportDoubleBuffer,
  786.  *            - you must eventually update the front buffer asynchronously
  787.  *        else
  788.  *            - you must eventually update the back buffer asynchronously
  789.  *            
  790.  *    REQUIRED
  791.  }
  792.  
  793. CONST
  794.     kQ3XMethodTypeRendererEndPass = 'rded';
  795.  
  796.  
  797. TYPE
  798. {$IFC TYPED_FUNCTION_POINTERS}
  799.     TQ3XRendererEndPassMethod = FUNCTION(view: TQ3ViewObject; rendererPrivate: UNIV Ptr): TQ3ViewStatus; C;
  800. {$ELSEC}
  801.     TQ3XRendererEndPassMethod = ProcPtr;
  802. {$ENDC}
  803.  
  804. {
  805.  *    kQ3XMethodTypeRendererEndFrame
  806.  *    TQ3XRendererEndFrame
  807.  *    
  808.  *    This call is only implemented by asynchronous renderers.
  809.  *
  810.  *    The EndFrame method is called from Q3View_Sync, which is
  811.  *    called after Q3View_EndRendering and signals that the user
  812.  *    wishes to see the completed image and is willing to block.
  813.  *    
  814.  *    If your renderer supports kQ3RendererFlagDoubleBuffer
  815.  *        - update the front buffer completely 
  816.  *    else
  817.  *        - update the back buffer completely
  818.  *
  819.  *    This call is equivalent in functionality to RendererFlushFrame
  820.  *    but blocks until the image is completed.
  821.  *    
  822.  *    If no method is supplied, the default is a no-op.
  823.  *    
  824.  *    NOTE: Registering a method of this type indicates that your renderer will
  825.  *    be rendering after Q3View_EndRendering has been called.
  826.  *    
  827.  *    OPTIONAL
  828.  }
  829.  
  830. CONST
  831.     kQ3XMethodTypeRendererEndFrame = 'rdsy';
  832.  
  833.  
  834. TYPE
  835. {$IFC TYPED_FUNCTION_POINTERS}
  836.     TQ3XRendererEndFrameMethod = FUNCTION(view: TQ3ViewObject; rendererPrivate: UNIV Ptr; drawContext: TQ3DrawContextObject): TQ3Status; C;
  837. {$ELSEC}
  838.     TQ3XRendererEndFrameMethod = ProcPtr;
  839. {$ENDC}
  840.  
  841. {
  842.  *    The RendererCancel method is called after Q3View_StartRendering
  843.  *    and signals the termination of all rendering operations.
  844.  *
  845.  *    A renderer should clean up any cached data, and cancel all 
  846.  *    rendering operations.
  847.  *    
  848.  *    If called before Q3View_EndRendering, the RendererEnd method
  849.  *    is NOT called.
  850.  *    
  851.  *    If called after Q3View_EndRendering, the renderer should kill
  852.  *    any threads and terminate any further rendering.
  853.  *    
  854.  *    REQUIRED
  855.  }
  856.  
  857. CONST
  858.     kQ3XMethodTypeRendererCancel = 'rdab';
  859.  
  860.  
  861. TYPE
  862. {$IFC TYPED_FUNCTION_POINTERS}
  863.     TQ3XRendererCancelMethod = PROCEDURE(view: TQ3ViewObject; rendererPrivate: UNIV Ptr); C;
  864. {$ELSEC}
  865.     TQ3XRendererCancelMethod = ProcPtr;
  866. {$ENDC}
  867.  
  868. {*****************************************************************************
  869.  **                                                                             **
  870.  **                        Renderer DrawContext Methods                         **
  871.  **                                                                             **
  872.  ****************************************************************************}
  873. {
  874.  *    kQ3XMethodTypeRendererPush
  875.  *    TQ3XRendererPushMethod
  876.  *    
  877.  *    kQ3XMethodTypeRendererPop
  878.  *    TQ3XRendererPopMethod
  879.  *    
  880.  *    These methods are called whenever the graphics state in the view
  881.  *    is pushed or popped. The user may isolate state by calling:
  882.  *    
  883.  *    Q3Attribute_Submit(kQ3AttributeTypeDiffuseColor, &red, view);
  884.  *    Q3Attribute_Submit(kQ3AttributeTypeTransparencyColor, &blue, view);
  885.  *    Q3Attribute_Submit(kQ3AttributeTypeSpecularColor, &white, view);
  886.  *    Q3Box_Submit(&unitBox, view);
  887.  *    Q3TranslateTransform_Submit(&unitVector, view);
  888.  *    Q3Push_Submit(view);
  889.  *        Q3Attribute_Submit(kQ3AttributeTypeDiffuseColor, &blue, view);
  890.  *        Q3Attribute_Submit(kQ3AttributeTypeTransparencyColor, &green, view);
  891.  *        Q3Box_Submit(&unitBox, view);
  892.  *    Q3Pop_Submit(view);    
  893.  *    Q3TranslateTransform_Submit(&unitVector, view);
  894.  *    Q3Box_Submit(&unitBox, view);
  895.  *    
  896.  *    or by submitting a display group which pushes and pops.
  897.  *    
  898.  *    If you support RendererPush and RendererPop in your renderer:
  899.  *        - you must maintain your drawing state as a stack, as well.
  900.  *        - you will not be updated with the popped state after
  901.  *            RendererPop is called.
  902.  *
  903.  *    If you do not support Push and Pop in your renderer:
  904.  *        - you may maintain a single copy of the drawing state.
  905.  *        - you will be updated with changed fields after the view stack is
  906.  *            popped.
  907.  *
  908.  *    A renderer that supports Push and Pop gets called in the following
  909.  *    sequence (from example above):
  910.  *    
  911.  *    RendererUpdateAttributeDiffuseColor(&red,...)
  912.  *    RendererUpdateAttributeTransparencyColor(&blue,...)
  913.  *    RendererUpdateAttributeSpecularColor(&white,...)
  914.  *    RendererUpdateMatrixLocalToWorld(...)
  915.  *    RendererSubmitGeometryBox(...)
  916.  *    RendererPush(...)
  917.  *        RendererUpdateAttributeDiffuseColor(&blue,...)
  918.  *        RendererUpdateAttributeTransparencyColor(&green,...)
  919.  *        RendererSubmitGeometryBox(...)
  920.  *    RendererPop(...)
  921.  *    RendererUpdateMatrixLocalToWorld(...)
  922.  *    RendererSubmitGeometryBox(...)
  923.  *
  924.  *    A renderer that does not supports Push and Pop gets called in the
  925.  *    following sequence:
  926.  *    
  927.  *    RendererUpdateAttributeDiffuseColor(&red,...)
  928.  *    RendererUpdateAttributeTransparencyColor(&blue,...)
  929.  *    RendererUpdateAttributeSpecularColor(&white,...)
  930.  *    RendererUpdateMatrixLocalToWorld(...)
  931.  *    RendererSubmitGeometryBox(...)
  932.  *        RendererUpdateAttributeDiffuseColor(&blue,...)
  933.  *        RendererUpdateAttributeTransparencyColor(&green,...)
  934.  *        RendererSubmitGeometryBox(...)
  935.  *    RendererUpdateAttributeDiffuseColor(&red,...)
  936.  *    RendererUpdateAttributeTransparencyColor(&blue,...)
  937.  *    RendererUpdateMatrixLocalToWorld(...)
  938.  *    RendererSubmitGeometryBox(...)
  939.  *    
  940.  }
  941.  
  942. CONST
  943.     kQ3XMethodTypeRendererPush    = 'rdps';
  944.  
  945.  
  946. TYPE
  947. {$IFC TYPED_FUNCTION_POINTERS}
  948.     TQ3XRendererPushMethod = FUNCTION(view: TQ3ViewObject; rendererPrivate: UNIV Ptr): TQ3Status; C;
  949. {$ELSEC}
  950.     TQ3XRendererPushMethod = ProcPtr;
  951. {$ENDC}
  952.  
  953.  
  954. CONST
  955.     kQ3XMethodTypeRendererPop    = 'rdpo';
  956.  
  957.  
  958. TYPE
  959. {$IFC TYPED_FUNCTION_POINTERS}
  960.     TQ3XRendererPopMethod = FUNCTION(view: TQ3ViewObject; rendererPrivate: UNIV Ptr): TQ3Status; C;
  961. {$ELSEC}
  962.     TQ3XRendererPopMethod = ProcPtr;
  963. {$ENDC}
  964.  
  965. {*****************************************************************************
  966.  **                                                                             **
  967.  **                            Renderer Cull Methods                             **
  968.  **                                                                             **
  969.  ****************************************************************************}
  970. {
  971.  *    kQ3XMethodTypeRendererIsBoundingBoxVisible
  972.  *    TQ3XRendererIsBoundingBoxVisibleMethod
  973.  *    
  974.  *    This method is called to cull complex groups and geometries 
  975.  *    given their bounding box in local space.
  976.  *    
  977.  *    It should transform the local-space bounding box coordinates to
  978.  *    frustum space and return a TQ3Boolean return value indicating
  979.  *    whether the box appears within the viewing frustum.
  980.  *    
  981.  *    If no method is supplied, the default behavior is to return
  982.  *    kQ3True.
  983.  *    
  984.  }
  985.  
  986. CONST
  987.     kQ3XMethodTypeRendererIsBoundingBoxVisible = 'rdbx';
  988.  
  989.  
  990. TYPE
  991. {$IFC TYPED_FUNCTION_POINTERS}
  992.     TQ3XRendererIsBoundingBoxVisibleMethod = FUNCTION(view: TQ3ViewObject; rendererPrivate: UNIV Ptr; {CONST}VAR bBox: TQ3BoundingBox): TQ3Boolean; C;
  993. {$ELSEC}
  994.     TQ3XRendererIsBoundingBoxVisibleMethod = ProcPtr;
  995. {$ENDC}
  996.  
  997.  
  998. {*****************************************************************************
  999.  **                                                                             **
  1000.  **                        Renderer Object Support Methods                         **
  1001.  **                                                                             **
  1002.  ****************************************************************************}
  1003. {
  1004.  *    Drawing methods (Geometry, Camera, Lights)
  1005.  *
  1006.  }
  1007. {
  1008.  *    Geometry MetaHandler
  1009.  *    
  1010.  *    This metaHandler is required to support 
  1011.  *    
  1012.  *    kQ3GeometryTypeTriangle
  1013.  *    kQ3GeometryTypeLine
  1014.  *    kQ3GeometryTypePoint
  1015.  *    kQ3GeometryTypeMarker
  1016.  *    kQ3GeometryTypePixmapMarker
  1017.  *    
  1018.  *    REQUIRED
  1019.  }
  1020.  
  1021. CONST
  1022.     kQ3XMethodTypeRendererSubmitGeometryMetaHandler = 'rdgm';
  1023.  
  1024.  
  1025. TYPE
  1026. {$IFC TYPED_FUNCTION_POINTERS}
  1027.     TQ3XRendererSubmitGeometryMetaHandlerMethod = FUNCTION(geometryType: TQ3ObjectType): TQ3XFunctionPointer; C;
  1028. {$ELSEC}
  1029.     TQ3XRendererSubmitGeometryMetaHandlerMethod = ProcPtr;
  1030. {$ENDC}
  1031.  
  1032. {
  1033.  *    The TQ3XRendererSubmitGeometryMetaHandlerMethod switches on geometryType
  1034.  *    of kQ3GeometryTypeFoo and returns methods of type:
  1035.  }
  1036. {$IFC TYPED_FUNCTION_POINTERS}
  1037.     TQ3XRendererSubmitGeometryMethod = FUNCTION(view: TQ3ViewObject; rendererPrivate: UNIV Ptr; geometry: TQ3GeometryObject; publicData: UNIV Ptr): TQ3Status; C;
  1038. {$ELSEC}
  1039.     TQ3XRendererSubmitGeometryMethod = ProcPtr;
  1040. {$ENDC}
  1041.  
  1042. {
  1043.  *    Camera MetaHandler
  1044.  *    
  1045.  *    This metaHandler, if supplied, indicates that your renderer
  1046.  *    handles deferred transformation of the main camera within a scene.
  1047.  *    
  1048.  *    If not supplied, or an unsupported camera is used, the view will do
  1049.  *    the transformation for the renderer and pass in a camera in the 
  1050.  *    StartPass method.
  1051.  *    
  1052.  *    OPTIONAL
  1053.  }
  1054.  
  1055. CONST
  1056.     kQ3XMethodTypeRendererSubmitCameraMetaHandler = 'rdcm';
  1057.  
  1058.  
  1059. TYPE
  1060. {$IFC TYPED_FUNCTION_POINTERS}
  1061.     TQ3XRendererSubmitCameraMetaHandlerMethod = FUNCTION(cameraType: TQ3ObjectType): TQ3XFunctionPointer; C;
  1062. {$ELSEC}
  1063.     TQ3XRendererSubmitCameraMetaHandlerMethod = ProcPtr;
  1064. {$ENDC}
  1065.  
  1066. {
  1067.  *    The TQ3XRendererSubmitCameraMetaHandlerMethod switches on cameraType
  1068.  *    of kQ3CameraTypeFoo and returns methods of type:
  1069.  }
  1070. {$IFC TYPED_FUNCTION_POINTERS}
  1071.     TQ3XRendererSubmitCameraMethod = FUNCTION(view: TQ3ViewObject; rendererPrivate: UNIV Ptr; camera: TQ3CameraObject; publicData: UNIV Ptr): TQ3Status; C;
  1072. {$ELSEC}
  1073.     TQ3XRendererSubmitCameraMethod = ProcPtr;
  1074. {$ENDC}
  1075.  
  1076. {
  1077.  *    Light MetaHandler
  1078.  *    
  1079.  *    This metaHandler, if supplied, indicates that your renderer
  1080.  *    handles deferred transformation of lights within a scene.
  1081.  *    
  1082.  *    If an unsupported light is encountered, it is ignored.
  1083.  *
  1084.  *    OPTIONAL
  1085.  }
  1086.  
  1087. CONST
  1088.     kQ3XMethodTypeRendererSubmitLightMetaHandler = 'rdlg';
  1089.  
  1090.  
  1091. TYPE
  1092. {$IFC TYPED_FUNCTION_POINTERS}
  1093.     TQ3XRendererSubmitLightMetaHandlerMethod = FUNCTION(lightType: TQ3ObjectType): TQ3XFunctionPointer; C;
  1094. {$ELSEC}
  1095.     TQ3XRendererSubmitLightMetaHandlerMethod = ProcPtr;
  1096. {$ENDC}
  1097.  
  1098. {
  1099.  *    The TQ3XRendererSubmitLightMetaHandlerMethod switches on lightType
  1100.  *    of kQ3LightTypeFoo and returns methods of type:
  1101.  }
  1102. {$IFC TYPED_FUNCTION_POINTERS}
  1103.     TQ3XRendererSubmitLightMethod = FUNCTION(view: TQ3ViewObject; rendererPrivate: UNIV Ptr; light: TQ3LightObject; publicData: UNIV Ptr): TQ3Status; C;
  1104. {$ELSEC}
  1105.     TQ3XRendererSubmitLightMethod = ProcPtr;
  1106. {$ENDC}
  1107.  
  1108. {
  1109.  *
  1110.  *    Update methods
  1111.  *
  1112.  *    They are called whenever the state has changed. If the renderer supports
  1113.  *    the RendererPush and RendererPop methods, it must maintain its own state
  1114.  *    stack. Updates are not called for changed data when the view stack is
  1115.  *    popped.
  1116.  *
  1117.  *    See the comments for the RendererPush and RendererPop methods above
  1118.  *    for an example of how data is updated.
  1119.  *
  1120.  }
  1121. {
  1122.  *    Style
  1123.  }
  1124.  
  1125. CONST
  1126.     kQ3XMethodTypeRendererUpdateStyleMetaHandler = 'rdyu';
  1127.  
  1128.  
  1129. TYPE
  1130. {$IFC TYPED_FUNCTION_POINTERS}
  1131.     TQ3XRendererUpdateStyleMetaHandlerMethod = FUNCTION(styleType: TQ3ObjectType): TQ3XFunctionPointer; C;
  1132. {$ELSEC}
  1133.     TQ3XRendererUpdateStyleMetaHandlerMethod = ProcPtr;
  1134. {$ENDC}
  1135.  
  1136. {
  1137.  *    The TQ3XRendererUpdateStyleMetaHandlerMethod switches on styleType
  1138.  *    of kQ3StyleTypeFoo and returns methods of type:
  1139.  }
  1140. {$IFC TYPED_FUNCTION_POINTERS}
  1141.     TQ3XRendererUpdateStyleMethod = FUNCTION(view: TQ3ViewObject; rendererPrivate: UNIV Ptr; publicData: UNIV Ptr): TQ3Status; C;
  1142. {$ELSEC}
  1143.     TQ3XRendererUpdateStyleMethod = ProcPtr;
  1144. {$ENDC}
  1145.  
  1146. {
  1147.  *    Attributes
  1148.  }
  1149.  
  1150. CONST
  1151.     kQ3XMethodTypeRendererUpdateAttributeMetaHandler = 'rdau';
  1152.  
  1153.  
  1154. TYPE
  1155. {$IFC TYPED_FUNCTION_POINTERS}
  1156.     TQ3XRendererUpdateAttributeMetaHandlerMethod = FUNCTION(attributeType: TQ3AttributeType): TQ3XFunctionPointer; C;
  1157. {$ELSEC}
  1158.     TQ3XRendererUpdateAttributeMetaHandlerMethod = ProcPtr;
  1159. {$ENDC}
  1160.  
  1161. {
  1162.  *    The TQ3XRendererUpdateStyleMetaHandlerMethod switches on attributeType
  1163.  *    of kQ3AttributeTypeFoo and returns methods of type:
  1164.  }
  1165. {$IFC TYPED_FUNCTION_POINTERS}
  1166.     TQ3XRendererUpdateAttributeMethod = FUNCTION(view: TQ3ViewObject; rendererPrivate: UNIV Ptr; publicData: UNIV Ptr): TQ3Status; C;
  1167. {$ELSEC}
  1168.     TQ3XRendererUpdateAttributeMethod = ProcPtr;
  1169. {$ENDC}
  1170.  
  1171. {
  1172.  *    Shaders
  1173.  }
  1174.  
  1175. CONST
  1176.     kQ3XMethodTypeRendererUpdateShaderMetaHandler = 'rdsu';
  1177.  
  1178.  
  1179. TYPE
  1180. {$IFC TYPED_FUNCTION_POINTERS}
  1181.     TQ3XRendererUpdateShaderMetaHandlerMethod = FUNCTION(shaderType: TQ3ObjectType): TQ3XFunctionPointer; C;
  1182. {$ELSEC}
  1183.     TQ3XRendererUpdateShaderMetaHandlerMethod = ProcPtr;
  1184. {$ENDC}
  1185.  
  1186. {
  1187.  *    The TQ3XRendererUpdateShaderMetaHandlerMethod switches on shaderType
  1188.  *    of kQ3ShaderTypeFoo and returns methods of type:
  1189.  }
  1190. {$IFC TYPED_FUNCTION_POINTERS}
  1191.     TQ3XRendererUpdateShaderMethod = FUNCTION(view: TQ3ViewObject; rendererPrivate: UNIV Ptr; VAR shaderObject: TQ3Object): TQ3Status; C;
  1192. {$ELSEC}
  1193.     TQ3XRendererUpdateShaderMethod = ProcPtr;
  1194. {$ENDC}
  1195.  
  1196. {
  1197.  *    Matrices
  1198.  }
  1199.  
  1200. CONST
  1201.     kQ3XMethodTypeRendererUpdateMatrixMetaHandler = 'rdxu';
  1202.  
  1203.  
  1204. TYPE
  1205.     TQ3XRendererUpdateMatrixMetaHandlerMethod = TQ3XMetaHandler;
  1206. {
  1207.  *    The TQ3XRendererUpdateShaderMetaHandlerMethod switches on methods
  1208.  *    of the form kQ3MethodTypeRendererUpdateMatrixFoo:
  1209.  }
  1210.  
  1211. CONST
  1212.     kQ3XMethodTypeRendererUpdateMatrixLocalToWorld = 'ulwx';
  1213.  
  1214.     kQ3XMethodTypeRendererUpdateMatrixLocalToWorldInverse = 'ulwi';
  1215.  
  1216.     kQ3XMethodTypeRendererUpdateMatrixLocalToWorldInverseTranspose = 'ulwt';
  1217.  
  1218.     kQ3XMethodTypeRendererUpdateMatrixLocalToCamera = 'ulcx';
  1219.  
  1220.     kQ3XMethodTypeRendererUpdateMatrixLocalToFrustum = 'ulfx';
  1221.  
  1222.     kQ3XMethodTypeRendererUpdateMatrixWorldToFrustum = 'uwfx';
  1223.  
  1224. {
  1225.  *    and returns methods of type:
  1226.  }
  1227.  
  1228. TYPE
  1229. {$IFC TYPED_FUNCTION_POINTERS}
  1230.     TQ3XRendererUpdateMatrixMethod = FUNCTION(view: TQ3ViewObject; rendererPrivate: UNIV Ptr; {CONST}VAR matrix: TQ3Matrix4x4): TQ3Status; C;
  1231. {$ELSEC}
  1232.     TQ3XRendererUpdateMatrixMethod = ProcPtr;
  1233. {$ENDC}
  1234.  
  1235.  
  1236. {$ALIGN RESET}
  1237. {$POP}
  1238.  
  1239. {$SETC UsingIncludes := QD3DRendererIncludes}
  1240.  
  1241. {$ENDC} {__QD3DRENDERER__}
  1242.  
  1243. {$IFC NOT UsingIncludes}
  1244.  END.
  1245. {$ENDC}
  1246.